SHELL := /bin/bash

INST_PATH=`pwd`/install
SQL_PATH=../sqlite

CFLAGS+=-I${INST_PATH}/include
LDFLAGS+=-L${INST_PATH}/libs -lmylib -lsqlite3

CC=gcc

all:
	@echo "Start complie library..."
	mkdir -p ${INST_PATH}/{bin,etc,include,libs}
	make -C ${SQL_PATH}
	make -C src		
	@echo "Start complie library..."
	${CC} ${CFLAGS} client.c -o client ${LDFLAGS} -lpthread -ldl -lm -g
	#${CC} ${CFLAGS} client.c -o client ${LDFLAGS} -lpthread -ldl -lm -Wl,--dynamic-list=dynamic_symbols.list
	make Install

Install:
	cp client ${INST_PATH}/bin

clean:
	make clean -C src
	make clean -C build

distclean: clean
	rm -f lib/*.a
	rm -f lib/*.so
